package interfaz;
import java.awt.Canvas;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.ImageProducer;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;

import javax.swing.WindowConstants;



/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaError extends javax.swing.JFrame {
	private JFrame formPadre;
	private JButton botonAceptar;
	private Canvas canvas1;
	private JLabel mensajeError;
	private JLabel jLabel1;
	private Image imagenError;
	
	public VentanaError(JFrame formPadre,String textoError) {
		super();
		this.formPadre = formPadre;
		initGUI();
		this.setLocationRelativeTo(null);
		formPadre.hide();
		this.setVisible(true);
		mensajeError.setText(textoError);
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("ERROR");
			getContentPane().setLayout(null);
			{
				botonAceptar = new JButton();
				botonAceptar.addActionListener (new ActionListener (){
					   public void actionPerformed (ActionEvent e){
						   hide();
						   formPadre.show();
					   } 
				});	
				getContentPane().add(botonAceptar);
				botonAceptar.setText("Aceptar");
				botonAceptar.setBounds(275, 190, 167, 23);
			}
			{
				jLabel1 = new JLabel();
				getContentPane().add(jLabel1);
				jLabel1.setText("Error");
				jLabel1.setBounds(342, 59, 163, 16);
			}
			{
				mensajeError = new JLabel();
				getContentPane().add(mensajeError);
				mensajeError.setBounds(105, 97, 547, 16);
			}
			pack();
			this.setSize(721, 300);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

}
